Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose around worker in Runtime builder #1557

Closed
wants to merge 3 commits into from

Conversation

LucioFranco
Copy link
Member

No description provided.

Copy link
Contributor

@jothan jothan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

core_threads seems mispelled as core_threds.

.unwrap()
.take()
.unwrap()
timers[index].lock().unwrap().take().unwrap()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this a rustfmt change?

@@ -58,6 +58,8 @@ pub struct Builder {

/// The clock to use
clock: Clock,

around_worker: Option<Arc<dyn Fn(&threadpool::Worker) + Send + Sync + 'static>>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: every other field has a doc comment, and this is one of the less self-explanatory fields IMO

tokio/src/runtime/threadpool/builder.rs Outdated Show resolved Hide resolved
Co-Authored-By: Eliza Weisman <eliza@buoyant.io>
Copy link
Member

@carllerche carllerche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One change request inline. Cheers 👍

where
F: Fn(&threadpool::Worker) + Send + Sync + 'static,
{
self.threadpool_builder.around_worker(f);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should set self.around_worker.

@carllerche
Copy link
Member

We probably should add a test too.

@carllerche
Copy link
Member

I'm going to close this PR as I believe #1657 takes over, but thanks for doing the work 👍

@carllerche carllerche closed this Oct 15, 2019
@carllerche carllerche deleted the lucio/expose-around-worker branch October 19, 2019 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants